# -*- coding: utf-8 -*-
# @Time: 2021/8/20 9:25
# @File: arg-58.py
# @DESC:

def func1(s):
    lent = len(s)
    flag = 0
    num = 0
    for i in range(lent):
        ch = s[lent - i - 1]
        if ch != " " and flag == 0:
            flag = 1
        if ch != " " and flag == 1:
            num += 1
        if ch == " " and flag==1:
            break
    return num


s = "luffy is still joyboy"
r = func1(s)
print(r)
